﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entity;
using Entity.Car_Rental;

namespace Data.Car_Rental
{
    public class StaticInfoRepository : Car_RentalRepositoryBase, IStaticInfoRepository
    {
        #region IRepository<StaticInfo> 成员

        public void Update(Entity.Car_Rental.StaticInfo entity)
        {
            base.UpdateEntity(entity);
        }

        public void Update(IList<Entity.Car_Rental.StaticInfo> list)
        {
            base.UpdateEntity(list.Cast<EntityBase>().ToList());
        }

        public void Insert(Entity.Car_Rental.StaticInfo entity)
        {
            base.InsertEntity(entity);
        }

        public void Insert(IList<Entity.Car_Rental.StaticInfo> list)
        {
            base.InsertEntity(list.Cast<EntityBase>().ToList());
        }

        public Entity.Car_Rental.StaticInfo InsertGetIDENTITY(Entity.Car_Rental.StaticInfo entity)
        {
            base.InsertEntity(entity);
            return Find(entity.PrimaryKey);
        }

        public void Delete(Entity.Car_Rental.StaticInfo entity)
        {
            base.DeleteEntity(entity);
        }

        public void Delete(IList<Entity.Car_Rental.StaticInfo> list)
        {
            base.DeleteEntity(list.Cast<EntityBase>().ToList());
        }

        public IQueryable<Entity.Car_Rental.StaticInfo> GetModel()
        {
            return base.GetEntities<StaticInfo>();
        }

        public Entity.Car_Rental.StaticInfo Find(params object[] keyValues)
        {
            return base.Find<StaticInfo>(keyValues);
        }

        #endregion

        #region IStaticInfoRepository 成员

        public PagedList<StaticInfo> GetStaticInfo(VPredication vp, PagingParam pp)
        {
            var linq = GetModel();
            return new PagedList<StaticInfo>(linq, pp.PageIndex, pp.PageSize);
        }

        #endregion
    }
}
